package com.mxpio.erp.common.sales.entity;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.mxpio.erp.common.jpa.model.BizOrderLine;
import com.mxpioframework.security.annotation.Dict;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_SALES_SO_LINE")
@ApiModel(value="销售订单行")
public class SalesOrderLine extends BizOrderLine {

	private static final long serialVersionUID = 1L;

	@Column(name = "JOIN_MAIN_PLAN_")
	@ApiModelProperty(value = "是否加入主计划")
	@Dict(dicCode = "ERP_COMMON_YESNO")
	private Boolean joinMainPlan ;

	@Column(name = "CST_STORE_NAME_")
	@ApiModelProperty(value = "客户存货名称")
	private String cstStoreName;

	@Column(name = "CST_MAIN_METERING_")
	@ApiModelProperty(value = "客户主计量")
	private String cstMainMetering;

	@Column(name = "QUANTITY_")
	@ApiModelProperty(value = "应发数量")
	private BigDecimal quantity;

	@Column(name = "DELIVER_DATE_")
	@ApiModelProperty(value = "交付日期")
	private Date deliverDate;

	@Column(name = "APPOINT_DELIVER_DATE_")
	@ApiModelProperty(value = "指定交付日期")
	private Date appointDeliverDate;

	@Column(name = "TAX_RATE_")
	@ApiModelProperty(value = "税率")
	private BigDecimal taxRate ;

	@Column(name = "UNTAX_PRICE_")
	@ApiModelProperty(value = "无税单价")
	private BigDecimal untaxPrice;

	@Column(name = "TAX_PRICE_")
	@ApiModelProperty(value = "含税单价")
	private BigDecimal taxPrice;

	@Column(name = "UNTAX_AMOUNT_")
	@ApiModelProperty(value = "无税金额")
	private BigDecimal untaxAmount;

	@Column(name = "TAX_")
	@ApiModelProperty(value = "税额")
	private BigDecimal tax;

	@Column(name = "TOTAL_AMOUNT")
	@ApiModelProperty(value = "价税合计")
	private BigDecimal totalAmount;

	@Column(name = "RECEIVING_COMPANY_")
	@ApiModelProperty(value = "收货单位")
	private String receivingCompany ;

	@Column(name = "RECEIVING_ADDRESS_")
	@ApiModelProperty(value = "收货地址")
	private String receivingAddress ;

	@Column(name = "RECEIVER_")
	@ApiModelProperty(value = "收货人")
	private String receiver ;

	@Column(name = "RECEIVER_CONTACTS_")
	@ApiModelProperty(value = "收货人手机")
	private String receiverContacts ;

	@Column(name = "MEMO_")
	@ApiModelProperty(value = "备注")
	private String memo;

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name="BIZ_NO_",insertable = false, updatable = false)
	@ApiModelProperty(value = "销售订单")
	private SalesOrder salesOrder;
}
